package com.apes.autoparts.masterdata.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.apes.framework.jpa.ApesBean;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @ClassName
 * @Description TODO
 * @Author pengyb
 * @Date 2019/11/19 11:33
 * @Version 1.0
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = "mas_pplx")
public class EpcBrandType implements ApesBean {
    @Id
    @Column(name = "PPLXID", length = 8)
    @Comment("品牌类型编码")
    private String id;

    @NotNull
    @Column(name = "PPLXMC", length = 64)
    @Comment("品牌类型")
    private String name;


    @Column(name = "PYM", length = 64)
    @Comment("拼音码")
    private String pinYingMa;

    @Column(name = "TS01", nullable = false, length = 36)
    private String time; //时间戳

    @NotNull
    @Column(name = "LRR", length = 64)
    @Comment("录入人")
    private String creatorName;

    @NotNull
    @JSONField(format = DateUtil.SHOW_DATE_FORMAT)
    @Temporal(TemporalType.DATE)
    @Column(name = "LRRQ_SJ")
    @Comment("录入日期")
    private Date entryDate; //录入日期


}
